package ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.mainframeSub;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JList;

import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.model.RFC;
import ch.bfh.abhmcm.SoftwareEngineeringAndDesign.view.mainframe.Mainframe;

public class ShowRFCFromListMouseListener extends MouseAdapter {

	private JList list;
	private Mainframe parent;

	public ShowRFCFromListMouseListener(Mainframe parent, JList jList) {
		this.list = jList;
		this.parent = parent;
	}

	@Override
	public void mouseClicked(MouseEvent e) {
		
		if (e.getClickCount() == 2) {

			new ShowAndCancelDialog(parent, (RFC) this.list.getSelectedValue());
		}

	}
}
